<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <%@ page language="java" contentType="text/html; charset=UTF-8"
             pageEncoding="UTF-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>湖北省第十七届运动会成绩信息发布</title>
    <meta name="keywords" content="湖北省运会成绩管理系统">
    <meta name="description" content="湖北省运会成绩管理系统">

    <link rel="icon" href="${contextPath}static/favicon.png" type="image/x-icon"/>
    <link rel="shortcut icon" href="${contextPath}static/favicon.png"/>
    <link href="${contextPath}static/css/bootstrap.min.css" rel="stylesheet">
    <link href="${contextPath}static/css/font-awesome.min.css" rel="stylesheet">
    <link href="${contextPath}static/css/sportPublic.css" rel="stylesheet">
    <link href="${contextPath}static/css/tab.css" rel="stylesheet">

    <script src="${contextPath}static/js/jquery-1.12.4.min.js?v=4"></script>
    <script src="${contextPath}static/js/bootstrap.min.js?v=4"></script>
    <script src="${contextPath}static/localijs/hhBase64.js?v=4"></script>
    <script src="${contextPath}static/localijs/App.js?v=8"></script>
    <script src="${contextPath}static/js/jquery.tabs.js"></script>

</head>
<body>
<div class="big-bg"></div>
<!-- 左边纵向导航 开始 -->
<div class="nav-vertical">
    <div class="sport-logo">
        <img src="${contextPath}static/images/real_logo.png">
        <span
                class="sport-logo-txt">2026 · 孝感</span>
    </div>
    <div class="sport-menu">
        <ul class="sport-menu-list">
            <li><a href="${contextPath}"> <i class="fa fa-futbol-o"></i>
                <span class="menu-li-txt">青少年体育类</span>
            </a></li>
            <li><a href="${contextPath}qzty"> <i class="fa fa-universal-access"></i> <span
                    class="menu-li-txt">群众体育类</span>
            </a></li>
            <li><a href="${contextPath}shjlb"> <i class="fa fa-universal-access"></i> <span
                    class="menu-li-txt">社会俱乐部类</span>
            </a></li>
            <c:if test="${type=='大学生'}">
                <li class="active">
                    <a href="${contextPath}zdxs">
                        <i class="fa fa-universal-access"></i>
                        <span class="menu-li-txt">大学生类</span>
                    </a>
                </li>

            </c:if>
            <c:if test="${type=='中学生'}">
                <li >
                    <a href="${contextPath}zdxs">
                        <i class="fa fa-universal-access"></i>
                        <span class="menu-li-txt">大学生类</span>
                    </a>
                </li>
            </c:if>

        </ul>

    </div>
</div>
<!-- 左边纵向导航 结束 -->
<div class="sport-content col-sm-12">
    <div class="sport-content-center">
        <div class="sport-title">湖北省第十七届运动会竞赛成绩信息发布</div>
        <div class="primary-content">
            <div class="primary-content-title">
                <h2>大学生类</h2>
                <div class="sport-tab">
                    <ul class="nav nav-tabs">
                        <c:if test="${type=='大学生'}">
                            <li><a href="${contextPath}zdxs">决赛成绩</a></li>

                        </c:if>
                        <c:if test="${type=='中学生'}">
                            <li><a href="${contextPath}zxs">决赛成绩</a></li>
                        </c:if>
                        <li class="active" ><a>奖牌榜</a></li>
                    </ul>
                </div>
            </div>
            <div class="wrapper-content">
                <div class="sport-cell">

                    <div class="every-bd box tabs">

                        <ul class="tab_menu">
                            <input type="hidden" class="current" value="${type}">
                        </ul>

                        <div class="tab_box">
                            <table class="table table-striped table-sport-item">
                                <thead>
                                <tr>
                                    <th style="text-align: center;">排名</th>
                                    <th style="text-align: center;">单位</th>
                                    <th style="text-align: center;">金牌🏅</th>
                                    <th style="text-align: center;">银牌🥈</th>
                                    <th style="text-align: center;">铜牌🥉</th>
                                    <th style="text-align: center;">积分</th>
                                </tr>
                                </thead>
                                <tbody>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="sport-footer">
            <p>建议使用IE9及以上版本浏览器 <br>版权所有 湖北省体育局</p>
        </div>
    </div>
</div>

<!-- 返回顶部 开始 -->
<div class="gototop" style="display: none;">
    <a href="javascript:;" title="返回顶部"><i class="fa fa-angle-up"></i></a>
</div>
<!-- 返回顶部 结束 -->
</body>
</html>
<script>
    $(function(){
        function startUp() {
            let tClass = $('.tab_menu .current').val()
            $.ajax({
                type:'get',
                url:'${contextPath}getRankingByTClass/'+tClass,
                dataType:'json',
                beforeSend : function() {
                    $("#Loading").show();
                },
                complete: function () {
                    $("#Loading").hide();
                },
                success: function(result){
                    $('table tbody').empty();
                    let trArr = [];
/*                     result.sort((a,b)=>{
                        if(a.jNum==b.jNum){
                            if(a.yNum==b.yNum){
                                if(b.tNum==a.tNum){
                                    return b.integral-a.integral
                                }
                                return b.tNum-a.tNum
                            }
                            return b.yNum-a.yNum
                        }
                        return b.jNum-a.jNum
                    }) */
                    for (let i = 0; i < result.length; i++) {
                        let bean = result[i];
                        trArr.push(
                            '<tr>' +
                            '    <td style="text-align: center;">'+bean.rank+'</td>' +
                            '    <td style="text-align: center;"><a onclick="getReportDetail(\''+bean.unit+'\',0)">'+bean.unit+'</a></td>' +
                            '    <td style="text-align: center;"><a onclick="getReportDetail(\''+bean.unit+'\',1)">'+defaultStringValue(bean.jNum)+'</a></td>' +
                            '    <td style="text-align: center;"><a onclick="getReportDetail(\''+bean.unit+'\',2)">'+defaultStringValue(bean.yNum)+'</a></td>' +
                            '    <td style="text-align: center;"><a onclick="getReportDetail(\''+bean.unit+'\',3)">'+defaultStringValue(bean.tNum)+'</a></td>' +
                            '    <td style="text-align: center;">'+defaultStringValue(bean.integral)+'</td>' +
                            '</tr>'
                        )
                    }
                    $('table tbody').append(trArr.join(''))
                }
            })
        }
        startUp()
    })
    // 月份切换
    $(".every-date-tab ul li").click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        var index = $(".every-date-tab ul li").index(this);
        $(".every-days-cell").eq(index).show().siblings().hide();
    })

    //返回顶部
    $(window).scroll(function () {
        if ($(window).scrollTop() >= 200) {
            $(".gototop").fadeIn(300);
        } else {
            $(".gototop").fadeOut(300);
        }
    })
    $(".gototop").click(function () {
        $('html,body').animate({'scrollTop': '0px'}, 300);
    })

    //表格展开收起
    $(".small-toggle").click(function () {
        if ($(this).find(".fa").hasClass('fa-arrow-circle-up')) {
            $(this).parents(".someone-item").find(".table-sport-item").slideUp(300);
            $(this).find(".fa").addClass('fa-arrow-circle-down').removeClass('fa-arrow-circle-up');
            $(this).find(".toggle-txt").text("展开");
        } else {
            $(this).parents(".someone-item").find(".table-sport-item").slideDown(300);
            $(this).find(".fa").addClass('fa-arrow-circle-up').removeClass('fa-arrow-circle-down');
            $(this).find(".toggle-txt").text("收起");
        }
    })
    function getReportDetail(unit,type){
        var w = window.open();
        w.location = '${contextPath}getMedalDetailForzdxs/'+unit+'/'+type
    }

    function defaultStringValue(value){
        if (value==null || value=='') {
            return 0;
        }
        return value
    }
</script>
